From 53ce8b9dd9534b805169dbeb715c75b72e2d708a Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Fri, 11 Nov 2005 17:56:02 +0100 Subject: [PATCH] Don't call iptables if it is not installed. This code is only there to ensure that packets between domU and the bridge are not firewalled, so if iptables is not installed, then there is no worry. Signed-off-by: Ewan Mellor --- tools/examples/vif-common.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/examples/vif-common.sh b/tools/examples/vif-common.sh index 0f8fcc706f..273cbacab5 100644 --- a/tools/examples/vif-common.sh +++ b/tools/examples/vif-common.sh @@ -53,7 +53,8 @@ function frob_iptable() local c="-D" fi - iptables "$c" FORWARD -m physdev --physdev-in "$vif" "$@" -j ACCEPT + iptables "$c" FORWARD -m physdev --physdev-in "$vif" "$@" -j ACCEPT || + fatal "iptables $c FORWARD -m physdev --physdev-in $vif $@ -j ACCEPT failed" } @@ -66,6 +67,11 @@ function frob_iptable() # function handle_iptable() { + if ! which iptables >&/dev/null + then + return + fi + if [ "$ip" != "" ] then local addr -- 2.30.2